Support multi-pin assigns in footprint pinning#509
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds tuple-style multi-pin footprint assignments and refactors part pinning maps, especially STM microcontrollers, to use the new system pin definition style.
Changes:
- Extends
FootprintBlock.footprintand IO controller pinning types to accept multi-pin keys. - Refactors many component footprint maps to group equivalent pins.
- Simplifies STM microcontroller variant classes by inlining single-package device definitions.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
edg/electronics_model/CircuitBlock.py |
Adds multi-pin footprint key expansion. |
edg/abstract_parts/IoController.py |
Updates system pinmap / pinning return types. |
edg/abstract_parts/BaseIoControllerWrapped.py |
Allows wrapped controller fixed pinning to use multi-pin keys without mutating inputs. |
edg/electronics_model/KiCadSchematicBlock.py |
Inlines generated pin mapping into footprint call. |
edg/parts/microcontroller/Stm32f103.py |
Refactors STM32F103 48-pin model to direct pin mappings. |
edg/parts/microcontroller/Stm32f303.py |
Refactors Nucleo F303K8 interfaces and pin mapping. |
edg/parts/microcontroller/Stm32g031.py |
Refactors STM32G031 package pin mapping. |
edg/parts/microcontroller/Stm32g431.py |
Refactors STM32G431 package pin mapping. |
edg/parts/microcontroller/Stm32l432.py |
Refactors STM32L432 package pin mapping. |
edg/parts/microcontroller/Rp2040.py |
Groups repeated RP2040 power pins. |
edg/parts/microcontroller/nRF52840.py |
Groups repeated nRF52840 ground pins. |
edg/parts/microcontroller/Lpc1549.py |
Updates pinmap typing and documents legacy variant style. |
edg/parts/microcontroller/Ice40up.py |
Groups repeated FPGA supply pins. |
edg/parts/microcontroller/Esp32.py |
Groups repeated ESP32 ground pins. |
edg/parts/microcontroller/Esp32c3.py |
Groups repeated ESP32-C3 supply pins and removes redundant annotations. |
edg/parts/microcontroller/Esp32s3.py |
Groups repeated ESP32-S3 ground pins and removes camera SCCB exposure. |
edg/parts/connector/UsbPorts.py |
Groups equivalent USB-C connector pins. |
edg/parts/display/oled/Nhd_312_25664uc.py |
Groups OLED interface pins tied to VSS. |
edg/parts/human_interface/Joystick_Xbox.py |
Groups joystick power and ground pins. |
edg/parts/interface/UsbInterface_Ft232h.py |
Groups FT232H supply and ground pins. |
edg/parts/interface/UsbPd_Fusb302b.py |
Groups FUSB302B supply and ground pins. |
edg/parts/power/converter/LinearRegulators.py |
Updates pinning type annotation. |
edg/parts/power/motor/Bldc_Drv8313.py |
Groups repeated motor driver supply and ground pins. |
edg/parts/power/motor/MotorDriver_L293dd.py |
Groups motor driver ground pins. |
edg/parts/power/motor/StepperDriver_A4988.py |
Groups A4988 ground pins. |
edg/parts/sensor/FlirLepton.py |
Groups repeated Lepton connector ground pins. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # C77994 for GD32F103C8T6, probably mostly drop-in compatible, NOT basic part | ||
| LCSC_BASIC_PART = True | ||
| self.assign(self.lcsc_part, "C8304") # max memory CBT6 variant | ||
| self.assign(self.actual_basic_part, False) |
Comment on lines
+118
to
+119
| for pin in pin_tuples: | ||
| pinning_array.append(f"{pin}={pin_port._name_from(self)}") |
| from ...circuits import * | ||
| from ...vendor_parts.jlc.JlcPart import JlcPart | ||
|
|
||
| # This file use an old style that uses inheritance to allow variations of the same chip. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
... and refactors some examples to use this.
Also restructures STM microcontrollers to use the new system pindef style from #508 . Updates the STM32F103 JLC metadata to reflect the part choice change from a prior PR.
Resolves #504